import Vue from 'vue'
import Vuex from 'vuex'
Vue.use(Vuex)

//2创建对象
const store = new Vuex.Store({
    state: {
        userInfo: {
            id: 0,
            username: "",
            gendar: 0,
            phone: "",
            pwd: "",
            imgurl: "",
            token: ''
        }
    },
    mutations: {
        saveUserInfo(state, userInfo) {
            console.log('test');
            state.userInfo=userInfo
        }
    },
    actions: {

    },
    getters: {

    }

})
//3导出对象
export default store